package com.xlh.param.courseTest;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.Valid;
import javax.validation.constraints.Max;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

/**
 * @author zhr 2019/2/27 选定题目不为空时，查询选定题目；选定题目为空时，查询模板id；两者都为空时，抛出异常
 */
@Data
public class PreviewPaperParam {
    // 模板id
    private Long modelId;
    // 选定题目id列表
    @Valid
    private List<PreviewQuestionParam> questionList;

    @NotBlank(message = "试卷名称不能为空")
    @Length(max = 20, message = "试卷名称最多填写20个字")
    private String paperName;

    @NotNull(message = "考试时间不能为空")
    @Max(value = 300, message = "考试时间最大为120分钟")
    private Integer timeLength;

    @NotNull(message = "结束类型不能为空")
    @ApiModelProperty("结束类型")
    private Integer endType;

    @ApiModelProperty("结束日期")
    private Date endDate;

}
